package com.molichuxing.services.property;

/**
 * 程包类型(1:基础，2：订阅)
 * @author xuelin yi
 */
public enum GoodsPackageTypeEnum {

  BASE(1, "基础里程包"),STAGES(2, "订阅里程包");

  int value;
  String name;

  GoodsPackageTypeEnum(int value, String name) {
    this.value = value;
    this.name = name;
  }

  public int getValue() {
    return value;
  }

  public String getName() {
    return name;
  }

  /**
   * 通过value获取枚举的name
   * @param value
   * @return
   */
  public static String getName(int value) {
    for (GoodsPackageTypeEnum orderSource : GoodsPackageTypeEnum.values()) {
      if (orderSource.getValue() == value) {
        return orderSource.name;
      }
    }
    return null;
  }
}
